<extend name="Public:base"/>

<block name="main">

<div id="yzh-content" class="col-xs-12">

    <div class="main-title">
        <h2>编辑角色</h2>
    </div>

    <form id="myform" class="form-horizontal" action="{:U('AdminRole/update')}" method="post">
        <div class="form-group">
            <label class="control-label col-md-2">角色名称</label>
            <div class="col-md-5">
                <input type="text" name="name" class="form-control"  value="{$vo['name']}"/>
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-md-2">是否激活</label>
            <div class="col-md-5">
            是<input type="radio" name="status" value="1" <eq name="vo['status']" value="1">checked="checked"</eq> />
            否<input type="radio" name="status" value="0" <eq name="vo['status']" value="0">checked="checked"</eq> />
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-md-2">描述</label>
            <div class="col-md-5">
            <textarea class="form-control" name="remark">{$vo['remark']}</textarea>
            </div>
        </div>

        <div class="form-actions">
            <input type="hidden" id="id" name="id" value="{$vo['id']}" />
            <input type="submit" value="提交" class="btn btn-sm btn-primary" >
            <input type="reset" value="取消" class="btn btn-sm btn-primary">
        </div>
  </form>
</div>

<script type="text/javascript">
$(document).ready(function() {
  $('#myform').ajaxForm({
    success:  complete,  // post-submit callback
    dataType: 'json'
  });
});

function complete(data){
    $.scojs_message(data.info, $.scojs_message.TYPE_OK);
    setTimeout(function(){
        window.location.href = '{:U("AdminRole/index")}';
    },1000);
}


</script>
</block>